home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / original / ch08 / mycommon.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-03-28  |  1.6 KB  |  53 lines

  1. VERSION 2.00
  2. Begin Form frmMyCommon 
  3.    Caption         =   "The MyCommon Program"
  4.    ClientHeight    =   4830
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1350
  7.    ClientWidth     =   7365
  8.    Height          =   5520
  9.    Icon            =   MYCOMMON.FRX:0000
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    Picture         =   MYCOMMON.FRX:0302
  13.    ScaleHeight     =   4830
  14.    ScaleWidth      =   7365
  15.    Top             =   720
  16.    Width           =   7485
  17.    Begin CommonDialog CMDialog1 
  18.       CancelError     =   -1  'True
  19.       Left            =   3120
  20.       Top             =   840
  21.    End
  22.    Begin Menu mnuFile 
  23.       Caption         =   "&File"
  24.       Begin Menu mnuSelect 
  25.          Caption         =   "&Select File..."
  26.       End
  27.       Begin Menu mnuExit 
  28.          Caption         =   "E&xit"
  29.       End
  30.    End
  31. Option Explicit
  32. Sub mnuExit_Click ()
  33.     End
  34. End Sub
  35. Sub mnuSelect_Click ()
  36.     On Error GoTo OpenError
  37.     ' Set the items of the File Type list box
  38.     CMDialog1.Filter = "All Files (*.*) |*.* |Text Files (*.txt)|*.txt|Doc Files (*.bat)|*.bat"
  39.     ' Set the default File Type to All Files (*.*)
  40.     CMDialog1.FilterIndex = 0
  41.     ' Display the dialog box
  42.     CMDialog1.Action = 1
  43.     ' Display the selected file
  44.     MsgBox "You selected: " + CMDialog1.Filename, 48
  45.     ' Exit this procedure
  46.     Exit Sub
  47. OpenError:
  48.     ' The user presed the Cancel key of the CMDialog1 control
  49.     MsgBox "No file was selected", 48
  50.     ' Exit this procedure
  51.     Exit Sub
  52. End Sub
  53.